package com.costeaalex.MIDlets.remote.threads;

import com.costeaalex.MIDlets.remote.communication.CommunicationManager;

public class Sender extends Thread
	{
	
	private CommunicationManager cML;
    private boolean isAlive;
	private int id=5; 
	
	public Sender(CommunicationManager cM)
		{
		cML=cM;
		isAlive=true;
		}
	
	public void run()
		{
		while(isAlive)
			{
			try
				{
				sleep(2000);
				}
			catch (InterruptedException e)
				{
				e.printStackTrace();
				}
			try
				{
				cML.send(new byte[] {1,0,0,2});
				}
			catch(Exception e)
				{
				e.printStackTrace();
				}
			}
		}

	public void destroy()
		{
		isAlive=false;
		}
	
	public int getServiceId()
		{
		return id;
		}
	
	}
